const express = require("express")
const app = express()

// 引入数据库链接文件
require('./db')

// 引入外部路由
const addAdminRoute = require("./routers/addAdmin")
const AdminListRoute = require("./routers/adminList")
const deleteAdminRoute = require("./routers/deleteAdmin")
const loginRoute = require("./routers/login")
const islogin = require("./routers/islogin")

// 处理body的中间件
app.use(express.urlencoded())
app.use(express.json())

// 使用外部路由
app.use(addAdminRoute)
app.use(AdminListRoute)
app.use(deleteAdminRoute)
app.use(loginRoute)
app.use(islogin)


app.listen("8080", () => {
  console.log('服务器启动成功');
})